// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
      obj:[],
  },
  bindPickerChange(e){
    
    let classid = e.detail.value
    let id = this.data.obj[classid].classifyId
    console.log(id);
    wx.navigateTo({
      url: "../book/book?id=" + id,
    })
    
  },
  onLoad() {
    let _this=this;
    wx.request({
      url: 'https://route.showapi.com/1700-1',
      method:'get',
      data:{'showapi_appid':1367085,
      'showapi_sign':'cb8507c33e4a43cfa34a954c91b91fd6',},
      header:{'Content-type':'application/json'},
      success(res){
          // console.log(res.data.showapi_res_body.storylist);
        _this.setData({obj:res.data.showapi_res_body.storylist})
        // console.log(_this.data.obj);
      },
      fail(err){
          console.log(err);
      }
    })
  },
 
})
